<template>
  <div id="app" v-if="bol">
    <!-- 
      定义：用symbol标签包住path,同时在symbol上加入id=值
      使用  <svg>
      <use href="#id值" />
        </svg>

     -->
    <!-- <svg width="128" height="100" xmlns="http://www.w3.org/2000/svg">
      <symbol id="xxx">
        <path
          d="M27.429 63.638c0-2.508-.893-4.65-2.679-6.424-1.786-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.465 2.662-1.785 1.774-2.678 3.916-2.678 6.424 0 2.508.893 4.65 2.678 6.424 1.786 1.775 3.94 2.662 6.465 2.662 2.524 0 4.678-.887 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm13.714-31.801c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM71.714 65.98l7.215-27.116c.285-1.23.107-2.378-.536-3.443-.643-1.064-1.56-1.762-2.75-2.094-1.19-.33-2.333-.177-3.429.462-1.095.639-1.81 1.573-2.143 2.804l-7.214 27.116c-2.857.237-5.405 1.266-7.643 3.088-2.238 1.822-3.738 4.152-4.5 6.992-.952 3.644-.476 7.098 1.429 10.364 1.905 3.265 4.69 5.37 8.357 6.317 3.667.947 7.143.474 10.429-1.42 3.285-1.892 5.404-4.66 6.357-8.305.762-2.84.619-5.607-.429-8.305-1.047-2.697-2.762-4.85-5.143-6.46zm47.143-2.342c0-2.508-.893-4.65-2.678-6.424-1.786-1.775-3.94-2.662-6.465-2.662-2.524 0-4.678.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.786 1.775 3.94 2.662 6.464 2.662 2.524 0 4.679-.887 6.465-2.662 1.785-1.775 2.678-3.916 2.678-6.424zm-45.714-45.43c0-2.509-.893-4.65-2.679-6.425C68.68 10.01 66.524 9.122 64 9.122c-2.524 0-4.679.887-6.464 2.661-1.786 1.775-2.679 3.916-2.679 6.425 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm32 13.629c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM128 63.638c0 12.351-3.357 23.78-10.071 34.286-.905 1.372-2.19 2.058-3.858 2.058H13.93c-1.667 0-2.953-.686-3.858-2.058C3.357 87.465 0 76.037 0 63.638c0-8.613 1.69-16.847 5.071-24.703C8.452 31.08 13 24.312 18.714 18.634c5.715-5.68 12.524-10.199 20.429-13.559C47.048 1.715 55.333.035 64 .035c8.667 0 16.952 1.68 24.857 5.04 7.905 3.36 14.714 7.88 20.429 13.559 5.714 5.678 10.262 12.446 13.643 20.301 3.38 7.856 5.071 16.09 5.071 24.703z"
        />
      </symbol>
    </svg> -->
    <!-- 需要多个地方使用该svg时，需要把svg特别处理 -->
    <!-- <svg>
      <use href="#xxx" />
    </svg>
    <svg>
      <use href="#icon-example" />
    </svg>
    <svg>
      <use href="#icon-eye" />
    </svg>
    <svg-icon iconClass="eye"></svg-icon>
    <br />
    <svg-icon iconClass="link"></svg-icon>
    <br />
    <svg-icon iconClass="user"></svg-icon>
    <br />
    <svg-icon iconClass="eye"></svg-icon> -->

    <router-view />
    <!-- 二级路由出口
    app.vue
       router-view  login   404   layout
    layout.vue
       Navbar上边导航, Sidebar左边菜单, AppMain内容
    AppMain:
       router-view:二级路由出口
     -->
  </div>
</template>

<script>
import { sysLogin } from '@/api/user'
export default {
  name: 'App',
  provide () {
    return {
      reload: this.reload
    }
  },
  data () {
    return {
      bol: true
    }
  },
  methods: {
    reload () {
      this.bol = false
      this.$nextTick(() => {
        this.bol = true
      })
    }
  },
  async created () {
    // const res = await sysLogin({
    //   mobile: '13800000002',
    //   password: '123456'
    // })
    // window.console.log('登陆返回数据:', res)
    // const res = await test()
    // window.console.log(res)
    // this.$store.dispatch('user/refreshUserInfo')
    window.console.log('router:', this.$router)
  }
}
</script>
<style lang="scss" scoped>
#app {
  background-color: #f0f2f5;
}
</style>
